package Demo2;

public class Test {
    //    public static void main(String[] args) {
//        //向上转型 + 动态绑定
////        People people = new Student("zhangsan",11);
////        //多态
////        people.eat();
////
////        //向下转型
////        Student stu1 = (Student) people;
////        stu1.show();
//    }
    public static void main(String[] args) {
        //方法重写不能使用private + static + final修饰
        People people = new Student("zhangsan", 18);

        //运行时报错
        Teacher teacher1 = (Teacher) people;
        teacher1.teach();

    }
}
